package com.power.sifa.net.api;

import com.plf.common.domain.ResponseDTO;
import com.plf.common.exception.BusinessException;
import com.power.sifa.net.model.Form_apply;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.util.Map;

public interface IApplyFeign {

    /**
     * 保存流程表单数据
     * @param form_apply
     * @return 结果Map<code: number, msg: string>, code == 0 说明保存成功
     */
    @PostMapping("/apply/saveApplyForm")
    ResponseDTO saveApplyForm(String formid, @RequestBody Form_apply form_apply) throws Exception;

    /**
     * 定时保存流程表单数据
     * @param form_apply
     * @return 结果Map<code: number, msg: string>, code == 0 说明保存成功
     */
    @PostMapping("/apply/fixedSaveApplyForm")
    ResponseDTO fixedSaveApplyForm(String formid, @RequestBody Form_apply form_apply);

    /**
     * 读取表单数据
     * @param formid 申请使用到的表
     * @return
     */
    @PostMapping("/apply/loadApplyForm")
    ResponseDTO loadApplyForm(@RequestParam String formid, @RequestParam String applyid) throws Exception;

    /**
     * 工作流读取表单数据
     * @param struct 申请使用到的表
     * @return
     */
    @PostMapping("/apply/flowLoadForm")
    ResponseDTO flowLoadForm(@RequestBody Map<String, Object> struct) throws Exception;

    /**
     * 提交申请表
     * @param applyid
     * @return
     */
    @PostMapping("/apply/submitApply")
    ResponseDTO submitApply(@RequestParam String applyid, @RequestParam String matid) throws BusinessException;



}
